package com.stellar.wechat.core.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * 会话信息封装类
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true) // 忽略未知字段
public class WxSessionInfo {

    /**
     * 用户唯一标识
     */
    private String openid;
    /**
     * 会话密钥
     */
    @JsonProperty("session_key") // 映射 JSON 的 session_key 到 sessionKey 字段
    private String sessionKey;
    /**
     * 用户在开放平台的唯一标识符，若当前小程序已绑定到微信开放平台帐号下会返回，详见 UnionID
     * @see <a href="https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html">UnionID</a>
     */
    private String unionid;

    public WxSessionInfo(String openid, String sessionKey, String unionid) {
        this.openid = openid;
        this.sessionKey = sessionKey;
        this.unionid = unionid;
    }

    public WxSessionInfo() {
    }

}